package zjut.raymond.common;

import java.util.Map;

/**
 * Result utils
 *
 * @author Raymond
 */
public class ResultUtils {
    /**
     * Success result api result
     *
     * @param data data
     * @return the api result
     */
    public static ApiResult successResult(Object data) {
        return new ApiResult<>(ApiCode.SUCCESS, data);
    }

    /**
     * Success result api result
     *
     * @return the api result
     */
    public static ApiResult successResult() {
        return successResult(null);
    }

    /**
     * Error result api result
     *
     * @return the api result
     */
    public static ApiResult errorResult() {
        return new ApiResult(ApiCode.FAIL, null);
    }
}
